"""
@name : tree命令
@author : liuyi
@projectname: Demo01
@time : 2022/3/5  18:13
"""
import os


def pytree(path, depth=0):
    if depth == 0:
        print(path)
    for file in os.listdir(path):
        print("|   " * depth, end="")
        print("|—— ", file)
        files = path + "\\" + file
        if os.path.isdir(files):
            pytree(files, depth + 1)


pytree(r"D:\GO")
